package com.jy.api.vo.pos.order;

import com.jy.api.domain.*;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by lihu on 2017/10/17.
 */
@Data
public class OrderVo {

    private String id;
    private String storeName;
    private String storeAddress;
    private String storeId;
    private String memberId;
    private String memberName;
    private String creatorId;
    private String creatorName;
    private String code;
    private double total = 0;
    private int count = 0;
    private double discount = 0;
    private double amount = 0;
    private Date paymentTime;
    private OrderStatus status;
    private OrderSource source;
    private OrderType type;
    private Date createTime;
    private List<OrderItem> items = new ArrayList<>();

    private double removeZero;

    private String channel;
    /**
     * 座位号
     */
    private String tableNo;
    private Date addTime;
    private Date updateTime;
    private boolean enabled = true;

    /**
     * 商品出入库状态
     */
    private boolean stock = false;
    /**
     * 备注
     */
    private String notes;

    /**
     * 退单原因
     */
    private String refundReason;


    private List<Payment> payments = new ArrayList<>();

    /**
     * 优惠卷使用信息
     */
    private List<CouponInstance> couponInstances = new ArrayList<>();

    private String partitionName;

    private String numName;


    @Data
    public static class Payment {
        private String id;
        private String orderId;
        private Date createTime;
        private String storeId;
        private Double amount;
        private boolean success = false;
        private String channel;
        private PaymentStatus status;
    }


    @Data
    public static class CouponInstance {


        /**
         * 优惠券名称
         */
        private String couponName;

        /**
         * 抵用商品id
         */
        private String productId;
        /**
         * 抵用商品名称
         */
        private String productName;
        /**
         * 优惠券实例编码
         */
        private String couponInstanceCode;
        /**
         * 抵用商品销售价格
         */
        private int productSalePrice;
        /**
         * 抵用商品数量
         */
        private short productQuantity;


    }
}
